package com.debai.mapper;

import com.debai.pojo.Position;
import org.apache.ibatis.annotations.*;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

@Mapper
public interface PositionMapper {
    //增加门店名称
    @Insert("insert into position_table(position_name,create_time,admin_id) values(#{positionName},now(),#{adminId})")
    int insert(Position position);

    @Select("select * from position_table ")
    List<Position> selectAll();

    @Delete("delete from position_table where id = #{id}")
    int delete(int id);

    @Update("update position_table set position_name = #{positionName} where id = #{id}")
    int update(Position position);

    @Select("select * from position_table where position_name=#{positionName}")
    Position selectByName(String positionName);

    @Select("select * from position_table where id=#{positionId}")
    Position selectById(int positionId);
}
